<template>
	<view class="goods-details">
		<navbar title="商品详情" :background="{background: `rgba(256,256,256,${percent})`}" :titleColor="`rgba(0,0,0,${percent})`" :immersive="true"></navbar>
		<!-- #ifdef H5 -->
		<download-nav v-if="showDownload" :top="44"></download-nav>
		<!-- #endif -->
		<loading-view v-if="isFirstLoading"></loading-view>
		<view class="contain" v-if="!isNull">
			<bubble-tips top="180rpx"></bubble-tips>
			<product-swiper :imgUrls="swiperList" :video="goodsDetail.video"></product-swiper>
			<view class="product-box mt20">
				<view class="title">{{goodsDetail.name}}</view>
				<text class="label">可用补贴¥{{goodsDetail.big_subsidy}}</text>
				<view class="desc">{{goodsDetail.remark}}</view>
				<view class="num-box row">
					<text>库存:{{goodsDetail.stock}}件</text>
					<text>浏览量:{{goodsDetail.click_count}}次</text>
				</view>
				<view class="price-box">
					<!-- is_bamboo_exchange 是否是玉竹兑换商品1-是2-否 -->
					<!-- 玉竹商品 -->
					<view class="price bamboo" v-if="goodsDetail.is_bamboo_exchange == 1">
						{{goodsDetail.min_yuzhu_price}}
						<template v-if="goodsDetail.min_yuzhu_price != goodsDetail.max_yuzhu_price">
							<text style="font-size: 46rpx;">-</text>
							{{goodsDetail.max_yuzhu_price}}
						</template>
						根玉竹
					</view>
					<!-- 普通商品 -->
					<view class="price" v-else>
						<price-format :first-size="46" :second-size="32" :subscript-size="32"
							:price="goodsDetail.min_price" :weight="500"></price-format>
						<template v-if="goodsDetail.min_price != goodsDetail.max_price">
							<text style="font-size: 46rpx;">-</text>
							<price-format :first-size="46" :second-size="32" :subscript-size="32"
								:show-subscript="false" :price="goodsDetail.max_price" :weight="500"></price-format>
						</template>
					</view>	
					<view class="mark-price">门市价<price-format :price="goodsDetail.market_price"></price-format></view>
				</view>
			</view>
			
			<view v-if="!goodsType" class="spec row bg-white mt20" @tap="showSpecFun(0)">
				<view class="text lighter">已选</view>
				<view class="line1 mr20" style="flex: 1;">{{ checkedGoods.spec_value_str || '默认' }}</view>
				<image class="icon-sm" src="/static/images/arrow_right.png"></image>
			</view>
			

			<!-- <view class="goods-like mt20 bg-white" v-if="goodsLike.length">
				<goods-like :list="goodsLike"></goods-like>
			</view> -->
			<!-- 请选择套餐 -->
			<!-- <view class="meal-box mt20">
				<view class="hd">
					<view class="tit">请选择套餐</view>
					<view class="meal-list">
						<text class="meal-item" :class="activeMeal == item.id ? 'active' : ''" v-for="item in mealList" :key="item.id" @tap="handleMeal(item.id)">{{item.name}}</text>
					</view>
				</view>
				<view class="bd">
					<view class="bd-item">
						<view class="sort-tit">锅底 （2选1）</view>
						<view class="sort-item">
							<view class="child-item">红锅</view>
							<view class="child-item">1份</view>
							<view class="child-item">¥38</view>
						</view>
						<view class="sort-item">
							<view class="child-item">菌汤鸳鸯锅</view>
							<view class="child-item">1份</view>
							<view class="child-item">¥138</view>
						</view>
					</view>
					<view class="bd-item">
						<view class="sort-tit">锅底</view>
						<view class="sort-item">
							<view class="child-item">串串60根签</view>
							<view class="child-item">1份</view>
							<view class="child-item">¥38</view>
						</view>
						<view class="sort-item">
							<view class="child-item">串串60根签</view>
							<view class="child-item">1份</view>
							<view class="child-item">¥38</view>
						</view>
					</view>
					<view class="bd-item">
						<view class="sort-tit">其他</view>
						<view class="sort-item">
							<view class="child-item">串串60根签</view>
							<view class="child-item">1份</view>
							<view class="child-item">¥38</view>
						</view>
						<view class="sort-item">
							<view class="child-item">串串60根签</view>
							<view class="child-item">1份</view>
							<view class="child-item">¥38</view>
						</view>
					</view>
				</view>
			</view> -->
			
			<!-- 适用门店 -->
			<view class="store-box mt20">
				<view class="tit">适用门店</view>
				<view class="content-box">
					<view class="row-between" v-for="(store, index) in goodsDetail.shops" :key="index">
							<view class="left row">
								<image :src="store.image" />
								<view class="info">
									<view class="info-tit">{{store.name}}</view>
									<view class="address">{{store.address}}</view>
								</view>
							</view>
							<view class="right row">
									<view class="right-item column" @tap="handleNavigation(store.lat,store.lng)">
										<image :src="`${imgPrefix}/images/xcxweb/details/navigation.png`" />
										导航
									</view>
									<view class="right-item column" @tap="handleCall(store.mobile)">
										<image :src="`${imgPrefix}/images/xcxweb/details/phone.png`" />
										电话
									</view>
							</view>
					</view>
					
				</view>
			</view>
			<view class="details mt20 bg-white">
				<view class="title lg">商品详情</view>
				<view class="content">
					<u-parse :html="goodsDetail.content" :lazy-load="true" :show-with-animation="true"></u-parse>
				</view>
			</view>
			<view class="footer row bg-white fixed">
				<navigator class="btn column-center" hover-class="none" open-type="switchTab"
					url="/pages/index/index">
					<image class="icon-md icon-img" :src="`${imgPrefix}/images/xcxweb/home.png`"></image>
					<text class="xs lighter">主页</text>
				</navigator>
				<button class="btn column-center" hover-class="none" @tap="collectGoodsFun">
					<image class="icon-md icon-img"
						:src="goodsDetail.is_collect == 1 ? `${imgPrefix}/images/xcxweb/icon_collection_s.png` : `${imgPrefix}/images/xcxweb/icon_collection.png`">
					</image>
					<text class="xs lighter">收藏</text>
				</button>
				<view class="right-buy br60 white mr20 ml10 md" @tap="showSpecFun(2)">{{ btnText.red }}</view>
			</view>
		</view>
		<view v-else>
			<view class="details-null column-center">
				<image class="img-null" :src="`${imgPrefix}/images/xcxweb/goods_null.png`"></image>
				<view class="xs muted">该商品已下架或不存在，去逛逛别的吧~</view>
			</view>
			<recommend></recommend>
		</view>
		<spec-popup :show="showSpec" :goods="goodsDetail" :is-seckill="goodsType == 1" @close="showSpec = false"
			:show-add="popupType == 1 || popupType == 0" :show-buy="popupType == 2 || popupType == 0"
			:showConfirm="popupType == 3" @buynow="onBuy" @addcart="onAddCart" @change="onChangeGoods"
			:group="Boolean(isGroup)" :red-btn-text="btnText.red" :yellow-btn-text="btnText.yellow"
			@confirm="onConfirm"></spec-popup>
			
		<share-popup v-model="showShareBtn" 
			:share-id="id" 
			pagePath="pages/goods_details/goods_details" 
			:type="1" 
			:config="{
				avatar: userInfo.avatar,
				nickname: userInfo.nickname,
				image: goodsDetail.poster || goodsDetail.image,
				price: goodsDetail.min_price,
				marketPrice: goodsDetail.market_price,
				name: goodsDetail.name
		}">
		</share-popup>

		<view class="share-money" :class="{ show: showCommission && enableCommission}">
			<view class="row-end">
				<view class="share-close row-center" @tap="showCommission=false">
					<u-icon name="close" size="16" color="#fff"></u-icon>
				</view>
			</view>
			<view class="share-con mt10" @tap="showShareBtn=true">
				<view class="primary" style="font-size: 45rpx;">
					{{distribution.earnings}}<text class="xs">元</text>
				</view>
				<view class="lighter xxs">
					好友下单最高可赚
				</view>
			</view>
		</view>
		
		<u-back-top :scroll-top="scrollTop" :top="1000" :customStyle="{ backgroundColor: '#FFF', color: '#000', boxShadow: '0px 3px 6px rgba(0, 0, 0, 0.1)'}"></u-back-top>
		
	</view>
</template>

<script>
	import {
		getGoodsDetail,
		addCart,
		getPoster,
	} from '@/api/store';
	import {
		collectGoods
	} from '@/api/user';
	import {
		getGoodsCoupon,
		teamCheck
	} from '@/api/activity';
	import {
		mapActions,
		mapGetters
	} from 'vuex';
	import {
		arraySlice,
		trottle
	} from '@/utils/tools';
	import {
		toLogin
	} from '@/utils/login';
	import {
		inputInviteCode
	} from '@/api/user';
	import Cache from '@/utils/cache';
	import {
		strToParams
	} from '@/utils/tools'
	import { baseURL } from "@/config/app"
	
	export default {
		data() {
			return {
				scrollTop: 0,
				percent: 0,
				isFirstLoading: true,
				isNull: false,
				showSpec: false,
				showShareBtn: false,
				showCommission: true,
				popupType: '',
				swiperList: [],
				goodsDetail: {},
				goodsLike: [],
				goodsType: 0,
				checkedGoods: {},
				couponList: [],
				comment: {},
				countTime: 0,
				tagStyle: {
					img: 'width:100%;'
				},
				team: {},
				teamFound: [],
				isGroup: 0,
				id: '',
				showDownload: false,
				distribution: {},
				mealList: [
					{
						id: 1,
						name: '小龙象特惠双人餐 ¥49'
					},
					{
						id: 2,
						name: '18.8代20元金券 ¥49'
					}
				],
				activeMeal: 1,
				imgPrefix: baseURL,
				is_buy_card_case: '', // 是否购买卡包，0 否 1是
			};
		},
		onLoad(options) {
			this.onPageScroll = trottle(this.onPageScroll, 500, this)
			if (options && options.scene) {
				let scene = strToParams(decodeURIComponent(options.scene));
				console.log(scene, decodeURIComponent(options.scene))
				options.id = scene.id;
			}
			// #ifdef H5
			if (options && options.isapp == 1) {
				this.showDownload = true;
			}
			// #endif
			if (!options.id) {
				return this.$toast({
					title: '缺少参数，无法查看商品'
				}, {
					tab: 3
				});
			} else {
				this.id = options.id;
			}
		},
		onShow() {
			this.getUser().then((data) => {
				 console.log('getUser-data:', data)
				 if(data){
					 this.is_buy_card_case = data.is_buy_card_case;
					 console.log('是否购买卡包:', this.is_buy_card_case)
				 }
			})
			this.getGoodsDetailFun();
		},
		onPageScroll(e) {
			const top = uni.upx2px(100)
			const {
				scrollTop
			} = e
			this.percent = scrollTop / top > 1 ? 1 : scrollTop / top
			this.scrollTop = scrollTop
		},
		methods: {
			...mapActions(['getUser']),
			handleCall(mobile){
				uni.makePhoneCall({
					phoneNumber: mobile,
					success: () => {
					  console.log('电话呼叫成功');
					},
					fail: (err) => {
					  console.error('电话呼叫失败', err);
					}
				});
			},
			handleMeal(id){
				this.activeMeal = id;
				console.log('this.activeMeal', this.activeMeal)
			},
			// 导航
			handleNavigation(lat, lng){
				console.log('lat, lng', lat, lng)
				uni.openLocation({
					latitude: lat*1,
					longitude: lng*1,
					success: function () {
						console.log('success');
					}
				});
			},
			async getGoodsDetailFun() {
				const {
					data,
					code
				} = await getGoodsDetail({
					id: this.id
				});
				if (code == 1) {
					let {
						goods_image,
						content,
						comment,
						like,
						activity,
						distribution
					} = data;
					let {
						info,
						team,
						team_found
					} = activity; //秒杀时间
					let time = info ?
						info.end_time - Date.now() / 1000 //拼团时间
						:
						team ?
						team.end_time - Date.now() / 1000 :
						0;

					if (team_found) {
						team_found = arraySlice(team_found, [], 2);
					}
					this.distribution = distribution || {}
					this.goodsDetail = data;
					this.swiperList = goods_image;
					this.comment = comment;
					this.goodsLike = like;
					this.countTime = time;
					this.goodsType = activity.type || 0;
					this.team = team ? team : {};
					this.teamFound = team_found ? team_found : [];

					this.$nextTick(() => {
						this.isFirstLoading = false;
					});
					// #ifdef H5
					let options = {
						shareTitle: data.name,
						shareLink: location.href + '&invite_code=' + this.userInfo.distribution_code,
						shareImage: data.image,
						shareDesc: data.remark
					};
					this.wxShare(options);
					// #endif
				} else {
					this.isNull = true
					this.isFirstLoading = false;
				}
			},
			async collectGoodsFun() {
				if (!this.isLogin) return toLogin();
				const {
					goodsDetail: {
						is_collect
					}
				} = this;
				const {
					data,
					code
				} = await collectGoods({
					is_collect: is_collect == 0 ? 1 : 0,
					goods_id: this.id
				});
				if (code == 1) {
					if (is_collect == 0) {
						this.$toast({
							title: '收藏成功'
						});
					} else {
						this.$toast({
							title: '取消收藏'
						});
					}
					this.getGoodsDetailFun();
				}
			},
			onChangeGoods(e) {
				console.log(e);
				this.checkedGoods = e.detail;
			},
			showSpecFun(type, id) {
				if (!this.isLogin) return toLogin();
				if (this.goodsType == 2 && [2, 3].includes(type)) {
					this.isGroup = 1;
					this.foundId = id;
				} else {
					this.isGroup = 0;
					this.foundId = '';
				}
				this.popupType = type;
				this.showSpec = true;
			},
			onBuy(e) {
				console.log('e.detail', e.detail)
				let {
					id,
					goodsNum
				} = e.detail;
				const {
					goodsType,
					team
				} = this;
				let goods = [{
					item_id: id,
					num: goodsNum
				}];
				const params = {
					goods,
				};
				this.showSpec = false;
				goodsType == 2 ? (params.teamId = team.team_id) : '';
				this.foundId ? (params.foundId = this.foundId) : '';
				let {is_selffetch, is_express, shops, is_bamboo_exchange} = this.goodsDetail
				params.is_selffetch = is_selffetch
				params.is_express = is_express
				params.shops = shops // 门店
				params.selffetch_shop_id = shops.length > 0 && shops[0].id // 门店ID，目前只有一个
				// is_bamboo_exchange 是否是玉竹兑换商品1-是2-否
				// pay_way支付方式：1微信支付 2支付宝支付  3玉竹支付
				params.pay_way = (is_bamboo_exchange == 1) ? 3 : 1
				console.log('confirm_order详情-params', params)
				
				let pages = getCurrentPages();
				console.log('pages', pages)
				console.log('pages.length', pages.length)
				// 页面栈总数大于10
				if (pages.length >= 10) {
					uni.redirectTo({
						url: '/pages/confirm_order/confirm_order?data=' + encodeURIComponent((JSON.stringify(params))),
						success(res) {
							console.log('success-res', res)
						},
						fail(err) {
							console.log('fail-res', err)
						}
					})
				}else{
					uni.navigateTo({
						url: '/pages/confirm_order/confirm_order?data=' + encodeURIComponent((JSON.stringify(params))),
						success(res) {
							console.log('success-res', res)
						},
						fail(err) {
							console.log('fail-res', err)
						}
					})
				}
				console.log(1111)
			},
			onConfirm(e) {
				const {
					team: {
						team_id
					}
				} = this;
				teamCheck({
					team_id,
					found_id: this.foundId
				}).then(res => {
					if (res.code == 1) {
						this.onBuy(e);
					}
				});
			},
			async onAddCart(e) {
				let {
					id,
					goodsNum
				} = e.detail;

				if (this.goodsType == 2) {
					// 拼团单独购买
					let goods = [{
						item_id: id,
						num: goodsNum
					}];
					uni.navigateTo({
						url: '/pages/confirm_order/confirm_order?data=' + encodeURIComponent((JSON.stringify({
							goods
						})))
					})
					return
				}
				const {
					code,
					data,
					msg
				} = await addCart({
					item_id: id,
					goods_num: goodsNum
				});
				if (code == 1) {
					this.$toast({
						title: msg,
						icon: 'success'
					});
					this.showSpec = false;
				}
			}
		},
		async onShareAppMessage() {
			const {
				goodsDetail,
				team,
				userInfo
			} = this;
			
			let path = '/pages/goods_details/goods_details?id=' + this.id
			if(this.is_buy_card_case == 1){ // 购买了卡包
				path = '/pages/goods_details/goods_details?id=' + this.id + "&invite_code=" + userInfo.distribution_code;
			}
			
			return {
				title: team.share_title || goodsDetail.name,
				imageUrl: goodsDetail.image,
				path: path,
			};
		},
		computed: {
			...mapGetters(['cartNum', 'userInfo']),
			btnText() {
				const {
					goodsType
				} = this;
				switch (goodsType) {
					case 1:
						return {
							red: '立即抢购',
								yellow: ''
						};
					case 2:
						return {
							red: '立即开团',
								yellow: '单独购买'
						};
					default:
						return {
							red: '立即购买',
								yellow: '加入购物车'
						};
				}
			},
			getTeamCountTime() {
				return time => time - Date.now() / 1000;
			},
			enableCommission() {
				const {
					goodsType,
					distribution: {
						earnings,
						is_show
					}
				} = this
				return goodsType == 0 && earnings > 0 && is_show == 1
			}
		}
	};
</script>

<style lang="scss" scoped>
	.goods-details {
		padding-bottom: calc(120rpx + env(safe-area-inset-bottom));
		
		.product-box{
			background: #FFF;
			padding: 22rpx 30rpx;
			border-radius: 16rpx;
			.title{
				font-weight: 700;
				font-size: 36rpx;
				color: #333333;
				line-height: 52rpx;
				letter-spacing: 1px;
				margin-bottom: 12rpx;
			}
			.label{
				padding: 6rpx 16rpx;
				background: rgba(255,197,82,0.3);
				border-radius: 8rpx 8rpx 8rpx 8rpx;
				font-size: 24rpx;
				color: #CC760C;
				line-height: 34rpx;
			}
			.desc{
				font-size: 28rpx;
				color: #666666;
				line-height: 40rpx;
				margin-bottom: 10rpx;
				margin-top: 14px;
			}
			.num-box{
				font-size: 24rpx;
				color: #999999;
				line-height: 34rpx;
				text{
					margin-right: 30rpx;
				}
			}
			.price-box{
				display: flex;
				align-items: baseline;
				margin-top: 22rpx;
				.price{
					font-weight: 700;
					font-size: 64rpx;
					color: #FF7125;
					line-height: 74rpx;
					margin-right: 28rpx;
					&.bamboo{
						font-size: 44rpx;
					}
				}
				.mark-price{
					font-weight: 400;
					font-size: 24rpx;
					color: #999999;
					line-height: 34rpx;
					text-decoration: line-through;
				}
			}
		}

		.seckill {
			height: 100rpx;
			background: #ffd4d8;

			.price {
				width: 504rpx;
				height: 100%;
				background: url(#{$img_prefix}/images/xcxweb/bg_seckill.png) no-repeat;
				background-size: 100%;
			}

			.down {
				flex: 1;
			}
		}

		.group {
			height: 100rpx;
			width: 100%;
			background-size: 100%;

			.group-num {
				border: 1px solid #ffffff;
				border-radius: 4rpx;

				.group-icon {
					background: #fff;
					padding: 3rpx 7rpx;
				}
			}

			.down {
				height: 100%;
				background-color: #fff5e1;
				padding: 0 20rpx;
			}
		}

		.goods-info {
			position: relative;

			.info-header {
				padding: 20rpx 0 0rpx 24rpx;

				.price {
					align-items: baseline;
				}
			}

			.vip-price {
				margin: 0 24rpx;
				background-color: #FFE9BA;
				color: #FFD4B7;
				line-height: 36rpx;
				border-radius: 6rpx;
				overflow: hidden;

				.price-name {
					background-color: #101010;
					padding: 3rpx 12rpx;
					position: relative;
					overflow: hidden;

					&::after {
						content: '';
						display: block;
						width: 20rpx;
						height: 20rpx;
						position: absolute;
						right: -15rpx;
						background-color: #FFE9BA;
						border-radius: 50%;
						top: 50%;
						transform: translateY(-50%);
						box-sizing: border-box;
					}
				}
			}

			.name {
				padding: 20rpx 24rpx;
				flex: 1;
			}

			.icon-share {
				width: 134rpx;
				height: 60rpx;
			}
		}

		.discount {
			padding: 24rpx;

			.text {
				width: 100rpx;
				flex: none;
			}

			.con {
				width: 400rpx;
			}

			.coupons-item {
				overflow: hidden;

				&>view {
					position: relative;
					height: 40rpx;
					line-height: 40rpx;
					padding: 0 18rpx;
					border-radius: 6rpx;
					box-sizing: border-box;
					background-color: $-color-primary;
					color: #fff;
					white-space: nowrap;
					overflow: hidden;

					&::after,
					&::before {
						content: '';
						display: block;
						width: 20rpx;
						height: 20rpx;
						position: absolute;
						left: -14rpx;
						background-color: #fff;
						border-radius: 50%;
						border: 1px solid currentColor;
						box-sizing: border-box;
					}

					&::after {
						right: -14rpx;
						left: auto;
					}
				}
			}
		}

		.details-null {
			padding-top: 140rpx;
			margin-bottom: 100rpx;
		}

		.spec {
			padding: 24rpx;

			.text {
				width: 100rpx;
			}
		}

		.evaluation {
			.title {
				height: 100rpx;
				border-bottom: $-solid-border;
				padding: 0 24rpx;
			}

			.con {
				padding: 30rpx 24rpx;
			}

			.user-info .avatar {
				width: 60rpx;
				height: 60rpx;
				border-radius: 50%;
			}
		}

		.details {
			.title {
				line-height: 88rpx;
				text-align: center;
			}

			&>.content {
				padding: 0 20rpx 20rpx;
				overflow: hidden;

				::v-deep image {
					vertical-align: middle;
				}

				// #ifdef H5
				::v-deep img {
					vertical-align: middle;
				}

				// #endif
				// #ifdef MP-WEIXIN || APP-PLUS
				::v-deep ._img {
					display: block;
				}

				// #endif
			}
		}
		.meal-box{
			padding: 30rpx;
			// border-radius: 16rpx;
			background: #FFF;
			.hd{
				padding-bottom: 28rpx;
				border-bottom: 2rpx solid #F5F5F5;
				.tit{
					font-weight: 500;
					font-size: 36rpx;
					color: #333333;
					line-height: 52rpx;
					margin-bottom: 30rpx;
				}
				.meal-list{
					.meal-item{
						padding: 14rpx 26rpx;
						font-size: 28rpx;
						color: #999999;
						line-height: 40rpx;
						border-radius: 8rpx;
						margin-right: 14rpx;
						background: #F1F1F1;
						border: 2rpx solid #F1F1F1;
						&.active{
							font-weight: 500;
							color: #CC760C;
							background: rgba(255,197,82,0.23);
							border-color: #FBA53B;
						}
						&:last-child{
							margin-right: 0;
						}
					}
				}
			}
			.bd{
				padding-top: 22rpx;
				.bd-item{
					.sort-tit{
						font-weight: 500;
						font-size: 28rpx;
						color: #333333;
						line-height: 40rpx;
						margin-bottom: 20rpx;
					}
					.sort-item{
						display: flex;
						font-size: 28rpx;
						color: #999999;
						line-height: 40rpx;
						margin-bottom: 20rpx;
						.child-item{
							&:first-child{
								width: 500rpx;
							}
							&:not(:first-child){
								flex: 1;
								text-align: center;
							}
						}
					}
				}
			}
		}
		.store-box{
			padding: 30rpx;
			// border-radius: 16rpx;
			background: #FFF;
			.tit{
				padding-bottom: 30rpx;
				font-weight: 500;
				font-size: 36rpx;
				color: #333333;
				line-height: 52rpx;
				border-bottom: 2rpx solid #F5F5F5;
			}
			.content-box{
				padding-top: 32rpx;
				.left{
					image{
						width: 80rpx;
						height: 80rpx;
						border-radius: 12rpx;
						margin-right: 18rpx;
					}
					.info{
						.info-tit{
							font-weight: 500;
							font-size: 28rpx;
							color: #333333;
							line-height: 40rpx;
							margin-bottom: 6rpx;
						}
						.address{
							width: 370rpx;
							font-size: 24rpx;
							color: #666666;
							line-height: 34rpx;
							overflow: hidden;
							white-space: nowrap;
							text-overflow: ellipsis;
						}
					}
				}
				.right{
					.right-item{
						font-size: 20rpx;
						color: #333333;
						line-height: 28rpx;
						image{
							width: 48rpx;
							height: 48rpx;
							margin-bottom: 6rpx;
						}
						&:first-child{
							margin-right: 38rpx;
						}
					}
				}
			}
		}
		.buy-notes-box{
			padding: 30rpx;
			// border-radius: 16rpx;
			background: #FFF;
			.hd{
				padding-bottom: 30rpx;
				font-weight: 500;
				font-size: 36rpx;
				color: #333333;
				line-height: 52rpx;
				border-bottom: 2rpx solid #F5F5F5;
			}
			.bd{
				padding: 30rpx 0;
				.item{
					font-size: 30rpx;
					color: #666666;
					line-height: 40rpx;
					.tit{
						margin-top: 20rpx;
						margin-bottom: 20rpx;
						font-weight: 600;
						font-size: 28rpx;
						color: #333333;
						line-height: 40rpx;
					}
				}
			}
		}

		.footer {
			height: 120rpx;
			position: fixed;
			bottom: 0;
			left: 0;
			right: 0;
			box-sizing: content-box;
			padding-bottom: env(safe-area-inset-bottom);

			.btn {
				width: 120rpx;
				height: 120rpx;
				position: relative;
				line-height: 1.3;
				.icon-img{
					margin-bottom: 10rpx;
				}
			}

			.add-cart,
			.right-buy {
				flex: 1;
				text-align: center;
				padding: 22rpx 0;
			}

			.add-cart {
				background-color: #ffa630;
			}

			.right-buy {
				background: linear-gradient( 118deg, #56C1C3 0%, #4D9D9F 100%);
			}
		}

		.group-play {
			.title {
				padding: 20rpx 28rpx;
				border-bottom: $-solid-border;
			}

			.steps {
				padding: 20rpx 28rpx;

				.step {
					flex: none;
				}

				.line {
					flex: 1;
					border: 1px dashed #999999;
					margin: 0 20rpx;
				}

				.number {
					border: 1rpx solid #707070;
					width: 28rpx;
					height: 28rpx;
					border-radius: 50%;
					line-height: 28rpx;
					text-align: center;
					margin-right: 6rpx;
				}
			}
		}

		.group-list {
			.group-item {
				padding: 20rpx 24rpx;

				&:not(:last-of-type) {
					border-bottom: $-solid-border;
				}

				.group-btn {
					background: linear-gradient(90deg, #f95f2f 0%, #ff2c3c 100%);
					height: 58rpx;
					padding-left: 28rpx;
					padding-right: 28rpx;
					margin-left: 30rpx;
					box-shadow: 0px 6rpx 12rpx rgba(249, 47, 138, 0.4);
				}
			}
		}

		.share-money {
			position: fixed;
			left: 20rpx;
			bottom: calc(130rpx + env(safe-area-inset-bottom));
			transform: scale(0);
			transition: all .3s;

			&.show {
				transform: scale(1);
			}

			.share-close {
				width: 34rpx;
				height: 34rpx;
				background: #a7a7a7;
				border-radius: 50%;
			}

			.share-con {
				background: url(#{$img_prefix}/images/xcxweb/bg_packet_img.png);
				width: 241rpx;
				height: 208rpx;
				background-size: 100%;
				padding-top: 20rpx;
				text-align: center;
			}
		}
	}
</style>
